<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        {{ price | currency }}
        {{ price | currency2('$') }}
        {{ 
            price | currency2
        }}
        {{ price | currency3 }}
    </div>
    <script src="./vue.js"></script>
    <script>
        // 定义一个过滤器
        Vue.filter("currency",(value)=>{
            return "￥"+value
        })
        // 定义一个 有参数的 过滤器
        Vue.filter("currency2",(value,sign="￥")=>{
            return sign+value
        })
        let vm = new Vue({
            el:"#app",
            data:{
                price:30
            },
            filters:{
                currency3:(value)=>{
                    return "￥"+value
                }
            }
        })
    </script>
</body>
</html>